﻿
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;

namespace MongodbTest
{
    class Program
    {
        static void Main(string[] args)
        {
     
        }
    }

    class ProxyObject : MarshalByRefObject
    {
        Assembly assembly = null;
        public void LoadAssembly()
        {
            assembly = Assembly.LoadFile(@"D:\zhongchen\LightingPlatform\NetLibraries\ICSharpCode.SharpZipLib.dll");
        }

        public void Test()
        {

        }

        public String  Invoke(string fullClassName, string methodName, params Object[] args)
        {
            if (assembly == null)
                return "";
            Type tp = assembly.GetType(fullClassName);
            if (tp == null)
                return "";
            MethodInfo method = tp.GetMethod(methodName);
            if (method == null)
                return "";
            Object obj = Activator.CreateInstance(tp);
            String res =  Convert.ToString ( method.Invoke(obj, args)) ;
            return res ;
        }
    }
}
